
//
//  MineBusinessCardBaseModel.m
//  Btpin
//
//  Created by Vic on 2019/4/7.
//  Copyright © 2019 Vic. All rights reserved.
//

#import "MineBusinessCardBaseModel.h"

@implementation MineBusinessCardBaseModel

- (void)setValuesForKeysWithDictionary:(NSDictionary<NSString *,id> *)keyedValues {
    self.type = [UIToolsControl dataAnalysis:keyedValues[@"type"]];
    self.userid = [UIToolsControl dataAnalysis:keyedValues[@"userid"]];
    self.name = [UIToolsControl dataAnalysis:keyedValues[@"name"]];
    self.avatar = [UIToolsControl dataAnalysis:keyedValues[@"avatar"]];
    self.position = [UIToolsControl dataAnalysis:keyedValues[@"position"]];
    self.weixin = [UIToolsControl dataAnalysis:keyedValues[@"weixin"]];
    self.weixin_img = [UIToolsControl dataAnalysis:keyedValues[@"weixin_img"]];
    self.telephone = [UIToolsControl dataAnalysis:keyedValues[@"telephone"]];
    self.email = [UIToolsControl dataAnalysis:keyedValues[@"email"]];
    
    self.skin_id = [UIToolsControl dataAnalysis:keyedValues[@"skin_id"]];
    self.skin_img = [UIToolsControl dataAnalysis:keyedValues[@"skin_img"]];
    
    self.company_info = [[MineBusinessCardBaseCompanyModel alloc] init];
    if (keyedValues[@"company_info"] && [keyedValues[@"company_info"] isKindOfClass:[NSDictionary class]]) {
        [self.company_info setValuesForKeysWithDictionary:keyedValues[@"company_info"]];
    }
    
    self.personal_info = [[MineBusinessCardBasePersonalModel alloc] init];
    if (keyedValues[@"personal_info"] && [keyedValues[@"personal_info"] isKindOfClass:[NSDictionary class]]) {
        [self.personal_info setValuesForKeysWithDictionary:keyedValues[@"personal_info"]];
    }
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    
}

- (id)copyWithZone:(NSZone *)zone {
    MineBusinessCardBaseModel *model = [[[self class] allocWithZone:zone] init];
    model.type = self.type;
    model.userid = self.userid;
    model.name = self.name;
    model.avatar = self.avatar;
    model.position = self.position;
    model.weixin = self.weixin;
    model.weixin_img = self.weixin_img;
    model.telephone = self.telephone;
    model.email = self.email;
    
    model.skin_id = self.skin_id;
    model.skin_img = self.skin_img;
    
    model.company_info = [self.company_info copy];
    model.personal_info = [self.personal_info copy];
    
    return model;
}

@end
